package org.zachary.commonservice.mapper;


import org.springframework.stereotype.Repository;
import org.zachary.commonservice.entity.CreditScoreStrategy;
import org.zachary.commonservice.entity.ServiceType;

import java.util.List;
import java.util.Optional;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.zachary.commonservice.entity.CreditScoreStrategy;
import java.util.List;
import java.util.Optional;

@Mapper
public interface StrategyMapper {
    /**
            * 根据服务名称查询策略
     * @param serviceName 服务名称
     * @return 策略列表
     */
    List<CreditScoreStrategy> selectByServiceName(String serviceName);

    /**
            * 根据服务类型和分数区间查询策略
     * @param type 服务类型枚举
     * @param score 用户信用分
     * @return 匹配的策略（Optional 包装）
            */
    Optional<CreditScoreStrategy> selectByTypeAndScore(
            @Param("type") String type,
            @Param("score") int score
    );
}
